#include "lineedit.h"

LineEdit::LineEdit(QWidget *parent) :
    QLineEdit(parent)
{}

void LineEdit::enterEvent(QEvent*)
{
    QPalette pal;
    pal.setColor(QPalette::Dark, Qt::black);
    pal.setColor(QPalette::Light, Qt::blue);
    setPalette(pal);
}

void LineEdit::leaveEvent(QEvent*)
{
    QPalette pal;
    pal.setColor(QPalette::Dark, Qt::black);
    pal.setColor(QPalette::Light, Qt::white);
    setPalette(pal);
}

void LineEdit::keyPressEvent(QKeyEvent *k)
{
    if (k->key() == Qt::Key_Down) emit pressKeyDown();
    QLineEdit::keyPressEvent(k);
}
